<?php

namespace App\Console\Commands;

use App\Customer;
use App\Lead;
use Illuminate\Console\Command;

class LeadFilterCommand extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'leadFilter:name';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Command description';

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * Execute the console command.
     *
     * @return mixed
     */
    public function handle()
    {
        Lead::where('owner_user_id',15)
            ->whereNotIn('leads_id',[7380,7393,7657,8994,16287,16307,16308,16309,16311])
            ->ChunkById(100,function ($leads){
                foreach ($leads as $newModel){
                    $newModel->create_user_id=1;
                    $newModel->save();
                }
            });

    }
}
